<template>
  <el-dialog
    :title="'详情'"
    append-to-body
    :close-on-click-modal="false"
    @close="closeDialog()"
    :visible="visible"
    width="1200px"
  >

    <div class="avue-crud">
      <el-table :data="dataList" border v-loading="dataListLoading">
        <el-table-column
          type="index"
          header-align="center"
          align="center"
          label="编号"
        >
        </el-table-column>
        <el-table-column
          prop="nickName"
          header-align="center"
          align="center"
          label="业代昵称"
        >
        </el-table-column>
        <el-table-column
          prop="loginAccount"
          header-align="center"
          align="center"
          label="登录手机号"
        >
        </el-table-column>
        <el-table-column
            prop="totalOrderCount"
            header-align="center"
            align="center"
            label="订单数量"
          >
          </el-table-column>
          <el-table-column
            prop="totalOrderPrice"
            header-align="center"
            align="center"
            label="订单金额"
            :formatter="formatMoney"
          >
          </el-table-column>
        
      </el-table>
    </div>
  
    <span slot="footer" class="dialog-footer">
      <el-button @click="closeDialog">取消</el-button>
    </span>
  </el-dialog>
</template>

<script>
import { getDetail } from "@/api/shop_report/custom_user_order_summary";

export default {
  props:{
    visible: {
      type: Boolean,
      default: false
    },
  },
  data() {
    return {
      dataList:[],
      dataListLoading: false,
    };
  },
  components: {
  },
  methods: {
    init(userIds, startTime, endTime) {
      if(userIds){
        this.dataListLoading = true;
        getDetail({
          ids: userIds,
          startTime: startTime,
          endTime: endTime
        }).then((response) => {
          this.dataListLoading = false;
          this.dataList = response.data.data;
        });
      }
      
    },

    //重置表单
    closeDialog() {
      this.$emit('update:visible', false)
    },
  },
};
</script>
